package 药品;

import com.alibaba.fastjson.JSON;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class MapTest extends Mapper<LongWritable, Text,JavaBean, NullWritable> {
    JavaBean k = new JavaBean();
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        k = JSON.parseObject(value.toString(),JavaBean.class);
        context.write(k,NullWritable.get());
    }
}
